﻿@model EasySamba.Models.EditViewModel

@if (@Model.CanFindName)
{
<form method="post" asp-action="UpdateEdit">
    <div class="panel panel-default form-group" style="margin-top:20px">
        <div class="panel-heading">
            <strong>修改共享</strong>
        </div>

        <div class="panel-body">
            <div class="input-group">
                <span class="input-group-addon">名称</span>
                <input asp-for="Name" type="text" class="form-control" readonly="readonly">
            </div>
            <br />
            <div class="input-group">
                <span class="input-group-addon">目录</span>
                <input asp-for="Path" type="text" class="form-control" placeholder="要共享的目录" data-val-required="目录不能为空！">
            </div>
            <span asp-validation-for="Path" class="text-danger" data-valmsg-for="Path" data--valmsg-replace="true"></span>
            <br />
            <div class="input-group">
                <span class="input-group-addon">用户</span>
                <input asp-for="User" type="text" class="form-control" placeholder="允许访问的用户（需要密码）">
            </div>
            <br />
            <div class="input-group">
                <span class="input-group-addon">
                    <input asp-for="ReadOnly" type="checkbox" value="true">只读
                </span>
                <input type="text" class="form-control" style="border-left:hidden" readonly="readonly" placeholder="访问者只能读取、不可修改">
            </div>
            <br />
            <div class="input-group">
                <span class="input-group-addon">
                    <input asp-for="EveryOne" type="checkbox">公开
                </span>
                <input type="text" class="form-control" style="border-left:hidden" readonly="readonly" placeholder="任何人都可以访问（无需密码）">
            </div>
        </div>
    </div>

    <a class="btn btn-default" href="/Easy/Index">取消</a>
    <button class="btn btn-primary" type="submit">确定</button>
</form>
}
else
{
    <div class="panel panel-default" style="margin-top:20px">
        <div class="panel-heading">
            <strong>出错了！</strong>
        </div>

        <div class="panel-body">
            没有找到名为<strong>@Model.Name</strong>的共享！
        </div>
    </div>

    <a class="btn btn-primary" href="/Easy/Index">返回</a>
}
